//
//  HomePageViewController.m
//  projecthz
//
//  Created by tali on 16/8/1.
//  Copyright © 2016年 tali. All rights reserved.
//

#import "HomePageViewController.h"
#import <MapKit/MapKit.h>

@interface HomePageViewController ()<MKMapViewDelegate, CLLocationManagerDelegate>

@property (nonatomic, strong) MKMapView *mapView;
@property (nonatomic, strong) CLLocationManager *manager;

@end

@implementation HomePageViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    [self configUI];
    
    
}

- (void)configUI{
    self.view.backgroundColor = [UIColor whiteColor];
    
    [self.view addSubview:self.mapView];
    
    [self.mapView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.view);
    }];
    
    
    
}

#pragma mark - Getters
-(MKMapView *)mapView{
    if (!_mapView) {
        _mapView = [[MKMapView alloc] initWithFrame:CGRectZero];
        _mapView.delegate = self;
        _mapView.userTrackingMode = MKUserTrackingModeFollowWithHeading;
        _mapView.mapType = MKMapTypeStandard;
    }
    return _mapView;
}

-(CLLocationManager *)manager{
    if (!_manager) {
        _manager = [[CLLocationManager alloc] init];
        [_manager setDelegate:self];
        [_manager setDesiredAccuracy:kCLLocationAccuracyBest];
    }
    return _manager;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
